﻿@using OrderSystem.Models
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Template.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easing.1.3.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ennui.contentslider.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" />
    @{
        var _db = new OrderSystemEntities();
        List<Items> lst = _db.Items.ToList();
        string page = HttpContext.Current.User.Identity.Name;
        switch (_db.Users.Single(u => u.Login == page).Role)
        {
            case "Administrator": page = "ADMINISTRATION"; break;
            case "Supervisor": page ="ITEMS MANAGEMENT"; break;
            default: page = "ORDERING"; break;
        }
    }
</head>
<body>
    <div id="templatemo_header_wrapper">
        <div id="templatemo_header">
            <div id="site_title">
                <h1>
                    <a href="#"><strong>Order Management System </strong><sup style="font-size: 12px;
                        color: red">BETA Version </sup><span>by C#09 Develop Group</span> </a>
                </h1>
            </div>
            <div id="templatemo_menu">
                <ul>
                    <li><a href="@FormsAuthentication.LoginUrl" class="current"> @page </a></li>
                    <li><a href="#"> ABOUT US </a></li>
                    <li><a href="" onclick="openUserInfo()"> USER INFO </a></li>
                    <li><a href="@Url.Action("Logout", "UserLogin")"> LOGOUT </a></li>
                    <li style="color: Yellow; padding-left: 30px; padding-right: 10px"><b>Logged user: &nbsp;
                        < @HttpContext.Current.User.Identity.Name > &nbsp; </b></li>
                </ul>
            </div>
            <div class="cleaner">
            </div>
        </div>
    </div>
    @if (HttpContext.Current.User.IsInRole("Customer"))
    {
        <div id="templatemo_slider_wrapper">
            <div id="templatemo_slider">
                <div id="one" class="contentslider">
                    <div class="cs_wrapper">
                        <div class="cs_slider">
                            @for (int i = 0; i < 5; i++)
                            {
                                <div class="cs_article">
                                    <div class="article">
                                        <div class="left">
                                            <h2 style="color: red"> NEW !!! </h2>
                                            <h2> @lst.ElementAt(i).ItemName</h2>
                                            <h3>Only @Convert.ToInt32(lst.ElementAt(i).Price) $</h3>
                                            <div class="button">
                                                <a href="#">More</a></div>
                                        </div>
                                        <div class="right">
                                            <a href="http://www.templatemo.com/page/1" target="_parent">
                                                <img src="@lst.ElementAt(i).Image" alt="template @i" />
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    }
    <div id="templatemo_content_wrapper">
        @RenderBody()
        <br/>
    </div>
</body>
<script type="text/javascript">
    $(function () {
                    $('#one').ContentSlider({
                        width: '910px',
                        height: '350px',
                        speed: 500,
                        easing: 'easeOutQuart'
                    });
                });
    function openUserInfo() 
    {
        window.open("@Url.Action("UserDetails", "OrderSystemUser")", "WindowPopup", "width=400px, height=400px, resizable");    
    } 
</script>
</html>
